#include "apue.h"
#include <time.h>
#include <sys/time.h>
int main() {
	time_t t = time(NULL);
	struct tm *tm_buf = localtime(&t);
	printf("tm_year = %d\n", tm_buf->tm_year + 1900);
	printf("tm_mon = %d\n", tm_buf->tm_mon + 1);
	printf("tm_mday = %d\n", tm_buf->tm_mday);
	printf("tm_hour = %d\n", tm_buf->tm_hour + 1);
	printf("tm_min = %d\n", tm_buf->tm_min);
	printf("tm_sec = %d\n", tm_buf->tm_sec);
	char stime[MAXLINE];
	strftime(stime, MAXLINE, "%c", tm_buf);
	printf("the current time is: %s\n", stime);
	return 0;
}
